<template>
  <div class="pie-echart">
    <hy-echart :options="options"></hy-echart>
  </div>
</template>

<script lang="ts" setup>
import { defineProps , computed} from 'vue'

import HyEchart from '@/base-ui/echart'
import { IDataType } from '../type'

const props = defineProps<{
  pieData: IDataType[]
}>()

const options = computed(() => {
  return {
    tooltip: {
      trigger: 'item'
    },
    legend: {
      orient: 'horizontal',
      left: 'left'
    },
    series: [
      {
        name: '分类数据',
        type: 'pie',
        radius: '50%',
        data:props.pieData,
        emphasis: {
          itemStyle: {
            shadowBlur: 10,
            shadowOffsetX: 0,
            shadowColor: 'rgba(0, 0, 0, 0.5)'
          }
        }
      }
    ]
  }
})


</script>

<style lang="less" scoped>

</style>
